///<reference path="../typings/index.d.ts"/>
import socketIOClient = require('socket.io-client');
import { urlencoded } from 'body-parser';
const translate = require('google-translate-api');
export class FXNewsManager {
    private url:string = "wss://sshcdhpjeg.jin10.com:8083";
    getNewsFromJIN10(){
        translate("tell me some ",{from:'en',to:'zh-cn'}).then(res=>{
            console.log(res.text);
        }).catch(err=>{
            console.log("translate error");
        });
       const client =  socketIOClient.connect(this.url);
       client.on("connect",()=>{
           console.log("fx news connected");
       });
       client.on("error",(err)=>{
           console.log("fx news connect error:"+err);
       });
       client.on("disconnect",()=>{
           console.log("fx new s disconnected");
       });
       client.on("user message",(data)=>{
           console.log(data)
           
       });
    }
}